package com.catsic.base;
/**
 * 自动生成主键
 **/
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
import org.joda.time.DateTime;

import com.catsic.base.domain.Domain;

@MappedSuperclass
public class BaseEntity implements Domain{
	
	@Id
    @GenericGenerator(name="systemUUID",strategy="uuid2")
    @GeneratedValue(generator="systemUUID")
	@Column(name="ID")
	private String id;
	
	@Column(name="CREATE_ID",updatable = false)
	private String createId;
	
	@Column(name="CREATE_NAME")
	private String createName;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME",updatable = false)
	private Date createTime=new Date();

	@Column(name="DESCRIPTION")
	private String description;

	public String getCreateId() {
		return createId;
	}

	public void setCreateId(String createId) {
		this.createId = createId;
	}

	public void setCreateName(String createName) {
		this.createName = createName;
	}

	public String getCreateName() {
		return createName;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public DateTime getCreateTime() {
		return null == createTime ? null : new DateTime(createTime);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}
